<?php

class Game{

	var $db;

	public function __construct(){
		$this->db = new DBClass();
	}
	
	public function get_all_game(){
		
		$query = "SELECT idgame, namagame, deskripsi, stok, harga, image, thnrilis, kategori, platform FROM game";
		$rows = $this->db->getRows($query);
		return $rows;	

	}

	public function insert_image(){
		$query = "INSERT INTO image SET image='".@$data['image']."'";

		$rows = $this->db->putRows($query);
		header('Location: insert_image.php');
	}

	public function game_detail($data){
		$query = "SELECT * FROM game WHERE idgame='".@$data."'";
		$rows = $this->db->getRows($query);
	}
}